import request from '../utils/request'

export function getBlogs() {
  return request({
    url: '/article/list',
    method: 'get'
  })
}

export function getBlogById(id) {
  return request({
    url: `/article/${id}`,
    method: 'get'
  })
}

export function createBlog(data) {
  return request({
    url: '/article',
    method: 'post',
    data
  })
}

export function updateBlog(id, data) {
  return request({
    url: `/article/${id}`,
    method: 'put',
    data
  })
}

export function deleteBlog(id) {
  return request({
    url: `/article/${id}`,
    method: 'delete'
  })
} 